/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apps.epocket.model;

import com.apps.epocket.dao.BasicEntity;
import com.te.cob.dao.SoftDeleteEntity;
import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author
 */
@Entity
@Table(name = "pguna")
@NamedQueries({
    @NamedQuery(name = "Pengguna.findAll", query = "SELECT p FROM Pengguna p")})
public class Pengguna implements Serializable, BasicEntity, SoftDeleteEntity {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_pguna")
    private String idPengguna;
    @Basic(optional = false)
    @Column(name = "katalaluan")
    private String password;
    @Column(name="aktif")
    private char aktif;
    @Embedded
    private InfoAudit infoAudit;

    public Pengguna() {
    }

    public String getIdPengguna() {
        return idPengguna;
    }

    public void setIdPengguna(String idPengguna) {
        this.idPengguna = idPengguna;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPengguna != null ? idPengguna.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pengguna)) {
            return false;
        }
        Pengguna other = (Pengguna) object;
        if ((this.idPengguna == null && other.idPengguna != null) || (this.idPengguna != null && !this.idPengguna.equals(other.idPengguna))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.te.cob.model.Pengguna[ userId=" + idPengguna + " ]";
    }

    public char getAktif() {
        return aktif;
    }

    public void setAktif(char aktif) {
        this.aktif = aktif;
    }
    
    @Override
    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    @Override
    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public String getId() {
        return this.idPengguna;
    }

    @Override
    public void sotfDelete() {
        setAktif('T');
    }
    
}
